#ifndef RIGIDBODY_H
#define RIGIDBODY_H

class RigidBody
{
	friend class Environment;
	friend struct ContactSolver;
protected:
    vector3 _position, _velocity;
    scalar _mass, _elastic;

    explicit RigidBody(scalar mass, scalar elasticity);
    RigidBody(const vector3 &pos, const vector3 &vel, scalar mass, scalar elasticity);
    RigidBody(const RigidBody &b);
public:
    virtual ~RigidBody();

    virtual void integrate(float time) = 0;
//    virtual void collideWith(const RigidBody&) = 0;

    scalar mass() const;
    scalar invMass() const;
    void mass(scalar);

    scalar elasticity() const;
    void elasticity(scalar);

    const vector3& velocity() const;
    void velocity(const vector3&);
    virtual void velocity(scalar x, scalar y, scalar z = 0);

    const vector3& position() const;
    void position(const vector3&);
    virtual void position(scalar x, scalar y, scalar z = 0);


    scalar pX() const;
    scalar pY() const;
    scalar pZ() const;

    scalar vX() const;
    scalar vY() const;
    scalar vZ() const;

//    void pX(scalar);
//    void pY(scalar);
//    void pZ(scalar);
//
//    void vX(scalar);
//    void vY(scalar);
//    void vZ(scalar);

};

#endif // RIGIDBODY_H
